package com.yipinhouse.backstage.client;

import com.yipinhouse.backstage.client.param.*;
import com.yipinhouse.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@FeignClient(contextId = "houseManageBackClient",name="backstage",path = "backstage")
public interface HouseManageWebClient {

    /**
     * 添加楼盘
     * @param param
     * @return
     */
    @PostMapping("/insertPremises")
    Result insertPremises(@Validated @RequestBody InsertPremisesWebParam param);

    /**
     * 修改楼盘信息
     * @param param
     * @return
     */
    @PutMapping("/updatePremises")
    Result updatePremises(@Validated @RequestBody UpdatePremisesWebParam param);

    /**
     * 上传楼盘附件
     * @param param
     * @return
     */
    @PostMapping ("/insertApartment")
    Result insertApartment(@Validated InsertApartmentWebParam param) throws Exception;

    /**
     *
     * @param id
     * @return
     */
    @DeleteMapping("/deletePremises")
    Result deletePremises(@RequestParam("id") Integer id);

    /**
     * 添加新房
     * @param param
     * @return
     */
    @PostMapping("/insertNewHouse")
    Result insertNewHouse(@Validated @RequestBody InsertNewHouseWebParam param);

    /**
     * 修改新房信息
     * @param param
     * @return
     */
    @PutMapping("/updateNewHouse")
    Result updateNewHouse(@Validated @RequestBody UpdateNewHouseWebParam param);

    /**
     * 删除新房
     * @param id
     * @return
     */
    @DeleteMapping("/deleteNewHouse")
    Result deleteNewHouse(@RequestParam("id") Integer id);

    /**
     * 修改房源状态为可售
     * @param houseId
     * @return
     */
    @PutMapping("/onSealHouse")
    Result onSealHouse(@RequestParam("houseId") Integer houseId);



    /**
     * 更改出租房源为待售
     * @param houseId
     * @return
     */
    @PutMapping("/resoldOnSaleHouse")
    Result resoldOnSaleHouse(@RequestParam("houseId")Integer houseId);

    /**
     * 下架出租房源
     * @param houseId
     * @return
     */
    @PutMapping("/resoldPullOffShelf")
    Result resoldPullOffShelf(@RequestParam("houseId") Integer houseId);



    /**
     * 修改房源状态为可售
     * @param houseId
     * @return
     */
    @PutMapping("/aOnSaleHouse")
    Result aOnSaleHouse(@RequestParam("houseId") Integer houseId);

    /**
     * 下架二手房源
     * @param houseId
     * @return
     */
    @PutMapping("aPullOffShelf")
    Result aPullOffShelf(@RequestParam("houseId") Integer houseId);

    /**
     * 同意房源
     * @param requestId
     * @return
     */
    @PutMapping("/passHouseRequest")
    Result passHouseRequest(@RequestParam("requestId") Integer requestId);

    /**
     * 拒绝房源
     * @param param
     * @return
     */
    @PutMapping("/rejectHouseRequest")
    Result rejectHouseRequest(@RequestBody RejectHouseWebRequestParam param);


}
